import { baseUrlConfig } from '@/config/config';
import request from '@/utils/request'

const bastPath = baseUrlConfig.processBaseUrl
//文件列表分页查询
export const enclosurePageList = (data: any) => {
  return request({
    url: bastPath + '/knowledge/documentEnclosure/find/page',
    method: 'post',
    data
  })
}
//导出
export const exportFile = (data: any) => {
  return request({
    url: bastPath + '/knowledge/documentEnclosure/dataExist?'+data,
    responseType: 'blob',
    method: 'get',
  })
  // return request({
  //   responseType: 'blob',
  //   url: bastPath + '/event/record/export',
  //   method: 'post',
  //   data
  // })
}
//上传文件
export const addFiles = (data: any) => {
  return request({
    url: bastPath + '/knowledge/documentEnclosure/add',
    method: 'post',
    data
  })
}
//文件删除
export const deleteFiles = (data: any) => {
  return request({
    url: bastPath + '/knowledge/documentEnclosure/deleteFileInfoByIds',
    method: 'delete',
    data
  })
}
//文件修改
export const UpdateFiles = (data: any) => {
  return request({
    url: bastPath + '/knowledge/documentEnclosure/update',
    method: 'post',
    data
  })
}
//文件复制
export const CopyFiles = (data: any) => {
  return request({
    url: bastPath + '/knowledge/documentEnclosure/copy',
    method: 'post',
    data
  })
}
//历史版本
export const getHistory = (data: any) => {
  return request({
    url: bastPath + '/knowledge/documentEnclosure/getHistory?id='+data,
    method: 'get',
  })
}
